'Apply the "Puzzle (Image)" layer style to the active layer

Private Sub Command1_Click()

Dim appRef As New Photoshop.Application
Dim docRef As Photoshop.Document
Dim artLayerRef As Photoshop.ArtLayer

If appRef.Documents.Count > 0 Then

    Set docRef = appRef.ActiveDocument
    Set artLayerRef = docRef.ActiveLayer
    If (artLayerRef.IsBackgroundLayer) Then
        artLayerRef.IsBackgroundLayer = False
    End If
    docRef.ActiveLayer.ApplyStyle "Puzzle (Image)"

End If

End Sub
